import { TypeOf, object, string } from "zod";

export const updateUserSchema = object({
  body: object({
    name: string(),
    email: string().email("Invalid email address"),
    password: string()
      .min(8, "Password must be more than 8 characters")
      .max(32, "Password must be less than 32 characters")
      .regex(
        /^(?=.*?[A-Z])(?=.*?[a-z])(?=.*?[\d])(?=.*?[^\sa-zA-Z0-9]).{8,}$/,
        "Password must contain at least one lowercase letter, one uppercase letter, one digit, and one special character",
      ),
  }).partial(),
});

export type UpdateUserSchema = TypeOf<typeof updateUserSchema>["body"];
